﻿// grafy_simple.cpp : Defines the entry point for the console application.
#pragma warning( disable : 4290 )

#include "stdafx.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include "grafy.h"
#include <time.h>
#include <cstdio>
#include <windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
__int64 t1,t2, freq;
	
        try
        {				
		//grafs lis(7,false);
		//grafl lis;
		//lis.loadsampleD();		
		
			grafl macka;
			//macka.fillrand();
			macka.loadsample();

			QueryPerformanceCounter( (LARGE_INTEGER*)&t1 );

			//lis.djikstra(1,6);
			//	lis.bell(3);
			cout<<macka.prim(1)<<endl;	
			//cout<<macka.kruskal()<<endl;	
	
 			QueryPerformanceCounter( (LARGE_INTEGER*)&t2 );
			QueryPerformanceFrequency( (LARGE_INTEGER*)&freq );
		 double czas = (double)( t2 - t1 )*1000 / freq;
		cout << "Algorytm wykonany w czasie: "<<czas<<"ms."<<endl;

        }
        catch(string wyjatek)
        {
			cout<<"\n\n Zlapano wyjatek:\n";
            cout<<wyjatek<<"\n";
        }

    system("PAUSE");
    return 0;
}






///macierz wag test
        //grafm tab_graf(5);
        //tab_graf.fillrand();
        //tab_graf.make_sym();
        //tab_graf.show();
        //cout<<"E="<<tab_graf.counte()<<"\n";
        //cout<<"v="<<tab_graf.getv()<<"\n";

        //cout<<"dodano e\n";
        //tab_graf.addv();
        //tab_graf.dele(2,0);
        //tab_graf.show();
        //cout<<"E="<<tab_graf.counte()<<"\n";
        //cout<<"v="<<tab_graf.getv()<<"\n";

        //cout<<"del e\n";
        //tab_graf.delv(2);
        //tab_graf.adde(2,2);
        //tab_graf.show();
        //cout<<"E="<<tab_graf.counte()<<"\n";
        //cout<<"v="<<tab_graf.getv()<<"\n";
        //grafm new_tab(tab_graf); //test konstruktora copy - working
        //new_tab.show();
///lista kraw test
			//grafl grafik;
			//cout<<grafik.getv()<<endl;
			//grafik.show();
			//cout<<grafik.countv();
///list check
/*			lista* lis=new lista;
			element* wsk;
			lis->push_back(1,2);
			lis->push_back(3,4);
			lis->push_back(7,4);
			lis->push_back(6,3);
			lis->show();
			cout<<"------------\n";
			lis->del(3);
			lis->show();		*/	